<template>
  <view>
    <!-- 登录状态下 我的协议 -->
    <view class="ad-option-list" v-if="login">
      <text class="ad-option-list__title ad-option-list__border">用户协议</text>
      <text
        class="ad-option-list__inner ad-option-list__border"
        v-for="(item, index) in agreementList1"
        :key="index"
        @tap="jumpTo(item.name)"
      >
        <text class="lg cuIcon-title"></text>
        <text>{{ item.name }}</text>
      </text>
    </view>

    <!-- 平台规则 -->
    <view class="ad-option-list">
      <text class="ad-option-list__title ad-option-list__border">平台规则</text>
      <view
        class="ad-option-list__inner ad-option-list__border"
        v-for="(item, index) in agreementList2"
        :key="index"
        @tap="jumpTo(item.name)"
      >
        <text class="lg cuIcon-title"></text>
        <text>《{{ item.name }}》</text>
      </view>
    </view>
  </view>
</template>

<script>
	const Page = require('../../utils/mtj-wx-sdk.js').Page;
export default {
  data() {
    return {
      agreementList1: [
        {
          name: "隐私协议",
          url: "url"
        }
      ],
      agreementList2: [
        {
          name: "职小侠平台注册协议"
        },
        {
          name: "职小侠平台须知"
        },
        {
          name: "职小侠隐私权政策"
        }
      ]
    };
  },
  methods: {
    jumpTo(title) {
      uni.navigateTo({
        url: `/pages/settingsPage/agreementPolicyShow?title=${title}`
      });
    }
  },
  computed: {
    login() {
      return this.$store.state.login;
    }
  }
};
</script>

<style lang="scss" scoped>
.ad-option-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  .ad-option-list__border {
    padding: 14px 16px 14px 0;
    margin-left: 16px;
    border: none;
    border-bottom: 1px solid #f5f5f5;
  }
  .ad-option-list__title {
    font-size: 17px;
    font-weight: 400;
    color: rgba(51, 51, 51, 1);
    line-height: 24px;
  }
  .ad-option-list__inner {
    font-size: 17px;
    font-weight: 400;
    color: rgba(16, 137, 255, 1);
    line-height: 24px;
    display: flex;
    flex-wrap: nowrap;
  }
}
</style>
